// 1. 穷举
test('穷举', function () {
    ok(solution1([1, 2, 4, 7, 11, 15], 15).toString() == '4,11', '输入: [1, 2, 4, 7, 11, 15], 15 输出: [4, 11]');
    ok(solution1([2, 4, 6, 8, 10, 12], 18).toString() == '6,12', '输入: [2, 4, 6, 8, 10, 12], 18 输出: [6, 12]');
    ok(solution1([23, 1, 5, 15, 30, 6], 21).toString() == '15,6', '输入: [23, 1, 5, 15, 30, 6], 21 输出: [15, 6]');
});

// 2. 二分查找
test('二分查找', function () {
    ok(solution2([1, 2, 4, 7, 11, 15], 15).toString() == '4,11', '输入: [1, 2, 4, 7, 11, 15], 15 输出: [4, 11]');
    ok(solution2([2, 4, 6, 8, 10, 12], 18).toString() == '6,12', '输入: [2, 4, 6, 8, 10, 12], 18 输出: [6, 12]');
    ok(solution2([23, 1, 5, 15, 30, 6], 21).toString() == '6,15', '输入: [23, 1, 5, 15, 30, 6], 21 输出: [6, 15]');
});

// 3. 双数组指针扫描
test('双数组指针扫描', function () {
    ok(solution3([1, 2, 4, 7, 11, 15], 15).toString() == '4,11', '输入: [1, 2, 4, 7, 11, 15], 15 输出: [4, 11]');
    ok(solution3([2, 4, 6, 8, 10, 12], 18).toString() == '6,12', '输入: [2, 4, 6, 8, 10, 12], 18 输出: [6, 12]');
    ok(solution3([23, 1, 5, 15, 30, 6], 21).toString() == '6,15', '输入: [23, 1, 5, 15, 30, 6], 21 输出: [6, 15]');
});

// 4. 借助 hash
test('借助 hash', function () {
    ok(solution4([1, 2, 4, 7, 11, 15], 15).toString() == '4,11', '输入: [1, 2, 4, 7, 11, 15], 15 输出: [4, 11]');
    ok(solution4([2, 4, 6, 8, 10, 12], 18).toString() == '6,12', '输入: [2, 4, 6, 8, 10, 12], 18 输出: [6, 12]');
    ok(solution4([23, 1, 5, 15, 30, 6], 21).toString() == '15,6', '输入: [23, 1, 5, 15, 30, 6], 21 输出: [15, 6]');
});

// 5. 双指针两端扫描
test('双指针两端扫描', function () {
    ok(solution5([1, 2, 4, 7, 11, 15], 15).toString() == '4,11', '输入: [1, 2, 4, 7, 11, 15], 15 输出: [4, 11]');
    ok(solution5([2, 4, 6, 8, 10, 12], 18).toString() == '6,12', '输入: [2, 4, 6, 8, 10, 12], 18 输出: [6, 12]');
    ok(solution5([23, 1, 5, 15, 30, 6], 21).toString() == '6,15', '输入: [23, 1, 5, 15, 30, 6], 21 输出: [6, 15]');
});
